#ifndef SIMPLEDEVICEITEM_H
#define SIMPLEDEVICEITEM_H

#include <QGraphicsRectItem>
#include <QObject>
#include <QString>

class SimpleDeviceItem : public QObject, public QGraphicsRectItem {
    Q_OBJECT
public:
    // pixmapPath: optional relative path to an image file. If provided and exists, the item will show the image.
    SimpleDeviceItem(const QString &id, const QString &label, const QString &pixmapPath = QString(), QGraphicsItem *parent = nullptr);
    QString id() const { return m_id; }

signals:
    void editRequested(const QString &id);
    void viewCurveRequested(const QString &id);

protected:
    void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;

private:
    QString m_id;
    QGraphicsPixmapItem *m_pixmapItem = nullptr;
};

#endif // SIMPLEDEVICEITEM_H
